#-*-coding:utf-8-*-
from django.contrib import admin
import xadmin
from xadmin import views

from models import *
# Register your models here.

# class BaseSetting(object):
#     enable_themes = True
#     use_bootswatch = True
#
#
# class GlobalSettings(object):
#     site_title = u"ITAdmin后台管理"
#     site_footer = u"ITAdmin"
#     menu_style = "accordion"


class ServerAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'memory', 'get_cpu', 'get_kernels', 'get_disks', 'get_ipaddress']


class CpuAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'kernel', 'frequency']


class DiskAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'mount_path', 'size']


class GeneratorRoomAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'address', 'phone_num', 'get_servers']


class IpAddressAdmin(admin.ModelAdmin):
    list_display = ['id', 'ip', 'type', 'get_server']


# admin.site.register(views.BaseAdminView, BaseSetting)
# admin.site.register(views.CommAdminView, GlobalSettings)
admin.site.register(Server, ServerAdmin)
admin.site.register(Cpu, CpuAdmin)
admin.site.register(Disk, DiskAdmin)
admin.site.register(GeneratorRoom, GeneratorRoomAdmin)
admin.site.register(IpAddress, IpAddressAdmin)